#include<stdio.h>
int main(){
	int n,i,x,j;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&x);
		if(x%2!=0)
		   printf("%d has no even factors\n",x);
		else{
			for(j=1;j<=x;j++){
				if(j%2==0 && x%j==0){
					printf("%d ",j);
				}
			}
		}
	}
	return 0;
}
